#include "decoder.h"

decoder::decoder()
{
        audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
        mediaObject = new Phonon::MediaObject(this);
        mediaObject->setTickInterval(1000);
        Phonon::createPath(mediaObject,audioOutput);
        connect(mediaObject,SIGNAL(aboutToFinish()),this,SIGNAL(AboutToFinish()));
}
void decoder::loadFile(QString file)
{
        mediaObject->stop();
        mediaObject->setCurrentSource(Phonon::MediaSource(file));
}
void decoder::play()
{
        mediaObject->play();
}
void decoder::pause()
{
        mediaObject->pause();
}


